import java.util.Scanner;

public class task2 {

	public static void main(String[] args) {
		int n, i=1 , freq;
		double total , value , max , avg;
			
		Scanner scanner = new Scanner(System.in);
		
		System.out.print("Enter how many values to consider:");
		n = scanner.nextInt();
		
		System.out.printf("Enter value %d:",i);
		value = scanner.nextDouble();
		
		max = value;
		freq = 1;
		total = value;
		
	if(n>1)
	{
		for(i=2 ; i<=n ; i++)
		{
		System.out.printf("Enter value %d:",i);
		value = scanner.nextDouble();
		
		if(value > max)
		{
			max = value;
			freq = 1;
		}
		else if(value == max)
		freq++;
			
		total = total + value;
		}
	}
		
		avg = total / n;
		
		System.out.printf("%n%nLargest value = %.2f%n",max);
		System.out.printf("The frequency of the largest value = %d%n",freq);
		System.out.printf("Average = %.2f", avg);
		
		scanner.close();
	}

}
